﻿
@model IEnumerable<QBWeb.Models.CurriculumFolder.Curriculum>

@{
    ViewBag.Title = "Index";
}



<br />
<p><a href="~/Home/Index">主页</a>> 课程中心</p>
<h2>课程中心</h2>

<div class="row" style="margin-top:20px">
    <div class="col-md-12">
        <div class="row">
            <div class="col-md-2">

                <span style="line-height:35px">课程信息</span>
            </div>
            <div class="col-md-8">

            </div>
            <div class="col-md-2 ">
                <button class="layui-btn layui-btn-normal pull-right" onclick="AddCurriculum()"><span class="glyphicon glyphicon-plus"></span>&nbsp;创建课程</button>
            </div>
        </div>

    </div>
</div>
<hr />

<div class="row">
    @if (!Model.Any())
    {
        <p  style="color:lightgray; font-size: 30px;text-align: center">无课程信息</p>
    }
    @foreach (var item in Model)
    {
        <div id="f_@item.Id" class="col-md-3" style="border: solid 1px lightgray; border-radius: 5px; margin: 8px; padding-bottom: 10px; width: 20%; position: relative;background: white">
            <button style="border: none; background: none; position: absolute; top: 5%; left: 90%" id="btnList_@item.Id" onmouseover="trigger(@item.Id)" data-id="List1">
                <span class="layui-icon layui-icon-more-vertical"></span>
            </button>
            <h3 id="curriName_@item.Id">@item.CurriName</h3>
            @*<h4 id="newName_@item.Id">@item.ClassName</h4>*@
            <span>加课码：@item.CurriCode</span>
            <p>
                <span id="year_@item.Id"> @item.Years </span>
                <br/>
                @if (int.Parse(item.Semester) == 1)
                {
                    <span id="semester_@item.Id">第一学期</span>
                }
                else
                {
                    <span id="semester_@item.Id">第二学期</span>
                }
            </p>
            <hr/>
            <span >成员：@item.Menbers 人</span>
            <div style="position: absolute; top: 80%; left: 50%">
                <button title="管理" type="button" class="layui-btn layui-btn-normal layui-btn-sm" onclick="GoTestPaper(@item.Id)">管理</button>
                <button title="进入" type="button" class="layui-btn  layui-btn-sm " onclick="OpenClass(@item.Id)"> 进入</button>
            </div>

            <a style="visibility: hidden" href="javascript:void(0);" id="linkToClass"></a>
            <!--暂未做详细界面-->
        </div>

        
    }


</div>

<script src="~/Scripts/Curricula/curriculum_operation.js"></script>
<script>
    function GoTestPaper(e) {
        $('#linkToClass').attr('href', `/TestPaperTbs/Index?Id=${e}`);
        document.getElementById('linkToClass').click();
    }
</script>